Avoid implicit time_t conversion in waypt_add that would result
authorrobertlipe <robertlipe@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Thu, 18 Jul 2013 03:10:00 +0000 (03:10 +0000)
committerrobertlipe <robertlipe@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Thu, 18 Jul 2013 03:10:00 +0000 (03:10 +0000)
in creation_time being zeroed.

gpsbabel/waypt.cc

index 176965ab06551ad2a003bdff76a18f06fbf5188b..dbb7ea686065d37291b60911a8697fb494081151 100644 (file)
@@ -158,7 +158,7 @@ waypt_add(waypoint *wpt)
   if ((wpt->longitude < -180) || (wpt->longitude > 180.0))
     fatal("Invalid longitude %f in waypoint %s.\n",
           lon_orig, wpt->shortname ? wpt->shortname : "");
-  if (wpt->creation_time < 0) {
+  if (!wpt->creation_time.isValid()) {
     warning("%s: Invalid timestamp in waypoint %s.\n",
             wpt->session->name,
             wpt->shortname ? wpt->shortname : "");